package com.itheima.service.impl;

import com.itheima.Mapper.OrderMapper;
import com.itheima.pojo.Order;
import com.itheima.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {
    
    @Autowired
    private OrderMapper orderMapper;
    
    @Override
    public Order findById(Integer id) {
        return orderMapper.findById(id);
    }
    
    @Override
    public List<Order> findByCustomerId(Integer customerId) {
        return orderMapper.findByCustomerId(customerId);
    }
    
    @Override
    public List<Order> findByStatus(String status) {
        return orderMapper.findByStatus(status);
    }
    
    @Override
    public List<Order> findByCustomerIdAndStatus(Integer customerId, String status) {
        return orderMapper.findByCustomerIdAndStatus(customerId, status);
    }
}
